/*
 * norx_bits.cpp
 * This file is part of norxx
 *
 * Copyright (C) 2014 - Sebastian Gesemann <s.gesemann@gmail.com>
 *
 * norxx is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * norxx is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with norxx. If not, see <http://www.gnu.org/licenses/>.
 */

#include "norx_bits.hpp"

namespace norx {

bool match(array_ref<const u8> x, array_ref<const u8> y)
{
	if (x.size()!=y.size()) return false;
	u8 xo = 0;
	for (unsigned i=0, e=x.size(); i<e; ++i) {
		xo |= x[i] ^ y[i];
	}
	return xo == 0;
}

} // namespace norx

